﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL_V1.App_Code.DBBroker;
using EntityObjects;
namespace BAL.Controller
{
    public class ViewCatalogueForEmployeeControl
    {
        CatalogueDBBroker cDB;
        public ViewCatalogueForEmployeeControl(){
            cDB=CatalogueDBBroker.getCatalogueDBBroker();
        }



        public List<Category> getCategory()
        {
            return cDB.selectAllCategory();
        }

        public List<Catalogue> searchByCategory(int p)
        {
            if (p != 0)
            {
                return cDB.selectCatalogueByCategoryId(p);
            }
            else if (p == 0)
            {
                return cDB.getCatalogueForClerk();
            }
            else return null;
        }

        public List<Catalogue> getCatalogue()
        {
            return cDB.getCatalogueForClerk();
        }
    }
}
